template(name="globalSearchHeaderBar")
  if currentUser
    h1
      i.fa.fa-search
      | {{_ 'globalSearch-title'}}

template(name="globalSearchModalTitle")
  if currentUser
    h2
      i.fa.fa-keyboard-o
      | {{_ 'globalSearch-title'}}

template(name="globalSearch")
  if currentUser
    .wrapper
      form.global-search-instructions.js-search-query-form
        input.global-search-query-input(type="text" name="searchQuery" placeholder="{{_ 'search-example'}}" value="{{ query.get }}" autofocus dir="auto")
      if searching.get
        +spinner
      else if hasResults.get
        .global-search-results-list-wrapper
          if hasQueryErrors.get
            div
              each msg in errorMessages
                span.global-search-error-messages
                  | {{_ msg.tag msg.value }}
          else
            h1
              = resultsHeading.get
              a.fa.fa-link(title="{{_ 'link-to-search' }}" href="{{ getSearchHref }}")
            each card in results
              +resultCard(card)
      else
        .global-search-instructions
          +viewer
            = searchInstructions

template(name="globalSearchViewChangePopup")
  if currentUser
    ul.pop-over-list
      li
        with "globalSearchViewChange-choice-me"
          a.js-global-search-view-me
            i.fa.fa-user.colorful
            | {{_ 'globalSearchViewChange-choice-me'}}
            if $eq Utils.globalSearchView "me"
              i.fa.fa-check
      li
        with "globalSearchViewChange-choice-all"
          a.js-global-search-view-all
            i.fa.fa-users.colorful
            | {{_ 'globalSearchViewChange-choice-all'}}
            span.sub-name
              +viewer
                | {{_ 'globalSearchViewChange-choice-all-description' }}
            if $eq Utils.globalSearchView "all"
              i.fa.fa-check
